<template>
  <div class="clock">
    <span class="value">{{ value }}</span>
  </div>
</template>

<script>
import dayjs from "dayjs";
export default {
  data() {
    return {
      value: "",
      timer: null,
    };
  },
  mounted() {
    this.timer = setInterval(() => {
      this.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
    }, 1000);
  },
  destroyed() {
    clearInterval(this.timer);
  },
};
</script>

<style lang="less" scoped>
.value {
  font-family: SourceHanSansSC-Medium;
  font-size: 36px;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #0d81ff;
}
</style>
